package com.yn.pet.bus.enums;

import lombok.Getter;

@Getter
public enum LocationTypeEnum {
    //gps
    GPS(0, "GPS"),
    //基站
    CELL(1, "基站"),
    //wifi
    WIFI(2, "wifi");

    private final Integer code;
    private final String name;

    LocationTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getName(Integer code) {
        for (LocationTypeEnum value : LocationTypeEnum.values()) {
            if (value.code.equals(code)) {
                return value.name;
            }
        }
        return null;
    }

}
